package mybatis;

/**
 * @author honway.liu
 * @date 2017/9/27 下午11:41
 * @email gm100861@gmail.com
 * @blog http://linuxsogood.org
 */
public class Change {

    public static void main(String[] args) {
        int a = 3;
        int b = 5;
        change(a, b);
        System.out.println("a=" + a + ", b=" + b);

        Integer c = 3;
        Integer d = 5;
        changeAgain(c, d);
        System.out.println("c=" + c + ", d=" + d);
    }

    private static void changeAgain(Integer c, Integer d) {
        int temp;
        temp = c;
        c = d;
        d = temp;
        System.out.println("after: a=" + c + ", b=" + d);
    }

    private static void change(int a, int b) {
        System.out.println("before: a=" + a + ", b=" + b);
        int temp;
        temp = a;
        a = b;
        b = temp;
        System.out.println("after: a=" + a + ", b=" + b);
    }
}
